"use strict";
/* function combineNumber(a: number, b: number): number {
  return a * b;
}

function combineString(a: string, b: string): string {
  return a + b;
} */
function combine(a, b) {
    if (typeof a === 'number' && typeof b === 'number') {
        return a * b;
    }
    else if (typeof a === 'string' && typeof b === 'string') {
        return a + b;
    }
    throw new Error("两个参数类型不一致");
}
const result = combine("a", 2);
console.log(result);
